﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "networkcommunication.h"

#include <QLabel>
#include <QTcpSocket>
#include <QMainWindow>
#include <QListWidgetItem>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    MainWindow(QWidget *parent = nullptr);
    QLabel* getlabel_id() const;
    QLabel* getlabel_name() const;
    void setuserid(const QString &userid);
    ~MainWindow();

private slots:
    void on_pushButton_flash_clicked();
    void flashfriendslist(QByteArray);

    void on_pushButton_send_clicked();
    void handle_forwardmsg(QByteArray);

    void on_listWidget_friend_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);

    void on_pushButton_emoji_clicked();

    void emojiChosenHandle(int id);
private:
    Ui::MainWindow *ui;
    QString userid;
    NetworkConnect *net;
    QTcpSocket *server;
};
#endif // MAINWINDOW_H
